<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=no">
	<title>搜索结果 - 日新网</title>
	<link rel="stylesheet" href="__TMPL__Public/assets/css/bootstrap.min.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/reset.css">
	<link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
	<script type="text/javascript" src="__TMPL__Public/assets/js/rem.js"></script>
	<style>
		.tab_nav li {
			width: 25%;
			text-align: center;
		}
		.expert_item{
			margin-bottom: .15rem;
		}
		 .col-xs-6 {
			padding: 0  .1rem;
		}
		input::-webkit-outer-spin-button,
		input::-webkit-inner-spin-button {
			-webkit-appearance: none;
		}
		input {
			outline:none;
		}
		.answers_name span:not(:last-child):after {
			content: "、";
		}
		/*专栏作者样式独立版*/
		@media screen and (max-width: 700px){
			.expert_info .expert_info_item {
				width: 94%;
				max-width: 330px;
				height: 80px;
				position: relative;
				border: 1px solid rgba(0,2,50,0.5);
				margin: 0 auto;
				margin-top: 50px;

			}
		}
		@media screen and (min-width: 749px) and (max-width: 751px){
			.expert_info .expert_info_item {
				width: 330px;
				height: 80px;
				position: relative;
				border: 1px solid rgba(0,2,50,0.5);
				margin-left: 20px;
				margin-top: 50px;
				float: left;

			}
		}

		.expert_info_item .ground_img{
			width: 60px;
			height: 60px;
			position: absolute;
			top: -30px;
			left: 10px;
		}
		.expert_info_item .ground_img img {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
		.expert_info_item  .info_top {
			padding-left: 80px;
			color: #000232;
			margin-top: -24px;
		}
		.expert_info_item  .info_top .name {
			font-size: 16px;
			font-weight: bolder;
			color: #000232;
			line-height: 22px;

		}
		.expert_info_item  .info_top span{
			color: #000232;
			font-size: 14px;
			font-weight: bolder;
			line-height: 22px;
		}
		.expert_info_item .text {
			font-size: 14px;
			color: #707070;
			margin: 16px 16px 16px;
			line-height: 18px;
		}
		.expert_info_item  .info_top .company {
			box-sizing: border-box;
			overflow: hidden;
			-ms-text-overflow: ellipsis;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	</style>
</head>
<body>
	<div class="search_header">
		<span id="close_search"></span>
		<input id="search_input" type="text">
		<i class="search_start"></i>
	</div>
	<div class="tab_nav " id="tab_nav">
		<ul class="comWidth clearfix">
			<li>文章</li>
			<li>快讯</li>
			<li>行家</li>
			<li>问答</li>
		</ul>
	</div>
	<div id="tab_content">
		<!--文章-->
		<div class="tab_content comWidth list_div">
			<volist name="lists" id="vo">
				<php>
					$smeta      = json_decode($vo['smeta'], true);
					$postdate   = time_format($vo['post_date']);
					$label_names= explode(',', $vo['label_names']);
				</php>
				<a href="{:U('article/article_info', ['id' => $vo['id']])}">
					<div class="tab_content_item">
						<div class="tab_img">
							<img class="my-photo" src="{:sp_get_asset_upload_path($smeta['thumb'])}" alt="">
						</div>
						<div class="tab_text">
							<p class="text_top ellipsis4">{$vo.post_title}</p>
							<div class="text_sub">
								<span>{$label_names[0]}</span>
								<p>
									<span class="name">{$vo.post_author_name|default=$vo['user_nicename']}</span>
									<span class="timer">{$postdate}</span>
								</p>
							</div>
						</div>
					</div>
				</a>
			</volist>
		</div>

		<!--快讯-->
		<div class="news comWidth list_div" style="display: none;">
			<volist name="lists" id="vo">
				<a href="#">
					<php>
						$postdate   = time_format($vo['post_date']);
						$label_names= explode(',', $vo['labels_name']);
					</php>
					<div class="news_item">
						<p>
							<span class="icon">●</span>
							<span class="text1">{$vo.post_title}</span>
						</p>
						<p  class="text2">{$vo.post_excerpt}</p>
						<p class="timer">{$postdate}</p>
					</div>
				</a>
			</volist>
		</div>

		<!--行家-->
		<div class="tab_content comWidth list_div"  style="display: none;" >
			<div class="expert_info">
				<ul>
					<volist name="lists" id="vo">
						<a href="{:U('User/index/professor_homepage', ['professor_id' => $vo['id']])}">
							<li class="expert_info_item">
								<div class="ground_img">
									<img class="my-photo" src="{:sp_get_user_avatar_url($vo['avatar'])}?t={:time()}" alt="">
								</div>
								<div class="info_top">
									<p class="name">{$vo.user_nicename|default=$vo['user_login']}</p>
									<p class="company">
										<span>{$vo.company}</span><span style="margin-left: 8px;">{$vo.position}</span>
									</p>
								</div>
								<p class="text ellipsis2">{$vo.signature}</p>
							</li>
						</a>
					</volist>
				</ul>
			</div>
		</div>

		<!--问答-->
		<div class="tab_content comWidth list_div"  style="display: none;" >
			<volist name="lists" id="vo">
				<php>
					$postdate = time_format($vo['post_date']);
				</php>
				<a href="{:U('Question/Question/question_info', ['id' => $vo['id']])}">
					<div class="answers">
						<h3 class="ellipsis2">{$vo.post_title}</h3>
						<p class="timer">{$postdate}</p>
						<p class="ellipsis1 answers_name">
							回答者:
							<volist name="vo.answer_names" id="vo_answer_name">
								<span>{$vo_answer_name}</span>
							</volist>
						</p>
					</div>
				</a>
			</volist>
		</div>
		<div style="height: .5rem;line-height: .5rem;background-color: #efdddd;" class="js-infinite-scroll-loading text-center">更多</div>
		<div id="nextpage"></div>
	</div>

	<script type="text/javascript" src="__TMPL__Public/assets/js/jquery.1.12.4.js"></script>
	<script src="__TMPL__Public/assets/js/bootstrap.min.js" ></script>
	<script src="__TMPL__Public/assets/js/jquery.infiniteScroll.js"></script>
	<script src="/public/slow_img/checkImg.js"></script>

	<!--tab页切换效果-->
	<script>
		(function () {
            $('#close_search').click(function () {
                window.location.href = "{:U('portal/index/index')}";
            });

            $('.search_keyword').click(function () {
                var keyword = $(this).text();
                window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword;
            });

            $('#search_input').change(function () {
                var keyword = $(this).val();
                window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword;
            });

            $('.search_start').click(function () {
                var keyword = $('#search_input').val();
                window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword;
            });

		    // 内容展示部分
            var list_index = "{$list_index}";
            $('#tab_nav ul li:eq(' + list_index + ')').addClass('active')
            $('.list_div:eq(' + list_index + ')').css('display', 'block').siblings().css('display', 'none');

            // 跳转链接
            $("#tab_nav ul li").on("click", function () {
                var index = $(this).index();
                window.location.href = "{:U('portal/search/index')}" + "&keyword=" + keyword + "&list_index=" + index;
            });

            // 搜索关键词设置
            var keyword = "{$keyword}";
            $("#nav li").on("click", function () {
                var index = $(this).index();
                window.location.href = "{:U('search/index')}" + "&keyword=" + keyword + "&list_index=" + index;
            });

            // 快讯展开收起效果
            $(document).ready(function () {
                $('.news_item').click(function () {
                    $(this).find('.text2').slideToggle("fast");
                })
            });

            // 加载更多
            $('#nextpage').infiniteScroll({
                loading:'.js-infinite-scroll-loading',
                total_pages:{$total_pages},
                success:function(content){
                    var items = $(content).find('.list_div:eq(' + list_index + ') a');
                    if(items.length > 0){
                        $('.list_div:eq(' + list_index + ')').append(items);
                    }
                }
            });
		})();
	</script>
</body> 
</html>